#ifndef PLUGINSMANAGERDAO_H
#define PLUGINSMANAGERDAO_H

#include <QCache>
#include <QList>

#include "../Pojo/pluginsmanager.h"
#include "../Specification.h"

class PluginsManagerDao
{
public:
	PluginsManagerDao();

	/* 查找 */
	PluginsManager* findOne(const quint32 &id);
	PluginsManager* findOne(const Specification &spec);

	QList<PluginsManager> findAll(const Specification &spec);

	/* 保存 */
	void save(const PluginsManager *pluginsManager);

	/* 删除 */
	void del(const quint32 &id);

private:
	/* 单条记录缓存，key:"id"，value:"PluginsManager" */
	static QCache<QString, PluginsManager> pluginsManagerCache;
	/* 缓存多条记录，key:"方法名+参数"，value：pluginsManager列表 */
	static QCache<QString, QList<PluginsManager>> pluginsManagersCache;
};

#endif // PLUGINSMANAGERDAO_H
